package ui;

import java.awt.Image;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

import javax.swing.ImageIcon;

public class Img {
	public Img() {
//		System.out.println("11");
//		setSkin("");
//		System.out.println("1");

	};
	

	public static Image lever = null;
	public static ImageIcon start = null;
	public static ImageIcon config = null;
	// ��װ����߽�ͼƬ
	public static Image window = null;
	// ��װ����ͼƬ
	public static Image ACT = null;
	// ��װ����ͼƬ
	public static Image num = null;
	// ���ݿ�ͼƬ
	public static Image db = null;
	public static Image disk = null;
	public static Image point = null;
	// ��װ����ͼƬ
	public static Image reline = null;

	// ��װ����ֵ��
	public static Image rect = null;
	// ��ӰͼƬ
	public static Image showdow = null;
	// ��ͣͼƬ
	public static Image pause = null;
	public static Image skin = null;
	/**
	 * ����ͼ�б�
	 */
	public static List<Image> BG_LIST;
	
	public static String Graphic_PATH = "Graphics/";
	private static String DEFAULT_PATH ="default";


	static {
		System.out.println("��ȡͼƬ�ļ�");
		setSkin(DEFAULT_PATH);
//		System.out.println("1");
	}
	public static void setSkin(String path) {
		String skinPath = Graphic_PATH + path;
		lever = new ImageIcon(skinPath + "/string/level.png").getImage();
		start = new ImageIcon(skinPath + "/string/start.png");
		config = new ImageIcon(skinPath + "/string/config.png");
		// ��װ����߽�ͼƬ
		window = new ImageIcon(skinPath + "/window/Window.png").getImage();
		// ��װ����ͼƬ
		ACT = new ImageIcon(skinPath + "/game/rect.png").getImage();
		// ��װ����ͼƬ
		num = new ImageIcon(skinPath + "/string/num.png").getImage();
		// ���ݿ�ͼƬ
		db = new ImageIcon(skinPath + "/string/db.png").getImage();
		disk = new ImageIcon(skinPath + "/string/disk.png").getImage();
		point = new ImageIcon(skinPath + "/string/point.png").getImage();
		// ��װ����ͼƬ
		reline = new ImageIcon(skinPath + "/string/rmline.png").getImage();

		// ��װ����ֵ��
		rect = new ImageIcon(skinPath + "/window/rect.png").getImage();
		// ��ӰͼƬ
		showdow = new ImageIcon(skinPath + "/game/shodow.png").getImage();
		// ��ͣͼƬ
		pause = new ImageIcon(skinPath + "/string/pause.png").getImage();
		skin = new ImageIcon(skinPath + "/view.png").getImage();

		// ����ͼƬ����
		BG_LIST = new ArrayList();
		File dir = new File(skinPath + "/background");
		File[] files = dir.listFiles();
		for (File file : files) {
			if (file.isDirectory()) {
				continue;
			}
			BG_LIST.add(new ImageIcon(file.getPath()).getImage());

		}

		// file.getPath();
		// System.out.println();

	}
	// ����ͼƬ
	// background = new ImageIcon(Graphic_PATH +
	// "/background/Light.jpg").getImage();

}
